# -*- coding: UTF-8 -*-
from mongoengine import *

connect('jianshu', host='127.0.0.1', port=27017)


class Article(Document):
    article_url = URLField()
    title = StringField()
    nick_name = StringField()
    notebook = StringField()
    content = ListField(StringField())
    words = IntField()
    likes = IntField()
    views = IntField()
    comments = IntField()
    rewards = IntField()
    total_likes = IntField()
    total_words = IntField()
    followers = IntField()
    pub_time = StringField()
    signature = StringField()
    avatar = StringField()
    theme = StringField()

    meta = {'collection': 'articles'}

    # def find(self,condition):


# for i in Article.objects[:10]:
#     print(i.title)
